/*
using MyGeneration/Template/NHibernate (c) by lujan99@usa.net
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// SystemUsers object for NHibernate mapped table 'system_users'.
	/// </summary>
	[Serializable]
	public class SystemUsers
	{
		#region Member Variables
		protected string _username;
		protected string _firstname;
		protected string _lastname;
		protected string _email;
		protected string _authlevel;
		protected string _userpassword;
		protected IList<Authorizations> _authorizations;
		#endregion
		#region Constructors
			
		public SystemUsers() {}
					
		public SystemUsers(string username, string firstname, string lastname, string email, string authlevel, string userpassword) 
		{
			this._username= username;
			this._firstname= firstname;
			this._lastname= lastname;
			this._email= email;
			this._authlevel= authlevel;
			this._userpassword= userpassword;
		}

		public SystemUsers(string email)
		{
			this._email= email;
		}
		
		#endregion
		#region Public Properties
		public string UserName
		{
			get { return _username; }
			set {_username= value; }
		}
		public string FirstName
		{
			get { return _firstname; }
			set {_firstname= value; }
		}
		public string LastName
		{
			get { return _lastname; }
			set {_lastname= value; }
		}
		public string Email
		{
			get { return _email; }
			set {_email= value; }
		}
		public string AuthLevel
		{
			get { return _authlevel; }
			set {_authlevel= value; }
		}
		public string UserPassword
		{
			get { return _userpassword; }
			set {_userpassword= value; }
		}
		public IList<Authorizations> Authorizations
		{
			get { return _authorizations; }
			set {_authorizations= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			SystemUsers castObj = (SystemUsers)obj;
			return ( castObj != null ) &&
			this._email == castObj.Email;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _email.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
